import { View, Text } from '@tarojs/components';
import './index.scss';

export default function ({ orderType, address, userPhone, userName, date }) {
  return (
    <View className="order-address section-block">
      <View className="address-text">
        <Text className="user-name-title">{orderType === 1 ? '收货地址' : '预约上门地址'}</Text>：
        {address}
      </View>
      {orderType === 2 && (
        <View className="address-text">
          <Text className="user-name-title">预约上门时间</Text>：{date}
        </View>
      )}
      <View className="user-info-text">
        <Text className="user-name-title">{orderType === 1 ? '收货人' : '预约人'}：</Text>
        <Text className="user-name">{userName}</Text>
        {userPhone}
      </View>
    </View>
  );
}
